package com.naiterui.ehp.bs.cms.modules.user.service;

import java.io.IOException;
import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.baomidou.mybatisplus.extension.service.IService;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.cms.common.vo.PageParamsVO;
import com.naiterui.ehp.bs.cms.common.vo.PageVO;
import com.naiterui.ehp.bs.cms.modules.user.entity.Doctor;
import com.naiterui.ehp.bs.cms.modules.user.vo.ConsultCommentVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.ConsultComplaintVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.DepartmentVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.DoctorDetailsVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.DoctorPageVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.HospitalVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.LoginLogVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.OcrParamVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.StandardDictVO;
import com.naiterui.ehp.bs.cms.modules.user.vo.record.RecordInfoVO;

public interface IDoctorService extends IService<Doctor> {

    PageVO<DoctorPageVO> queryPage(PageParamsVO pageParamsVO, DoctorPageVO doctorVO);

    DoctorDetailsVO getDoctorDetailsVO(Long doctorId);

    String uploadSealImg(MultipartFile file, Long doctorId) throws IOException;

    List<HospitalVO> getHospitalByCityId(Long cityId);

    List<DepartmentVO> getAllDepartment(Long type);

    void removeHospitalCacheByCityId(Long cityId);

    RecordInfoVO recordInfo(Long doctorId);

    void updateRecordInfo(RecordInfoVO recordInfoVO) throws BusinessException;

    List<StandardDictVO> getStandardDict();

    String uploadFile(Long doctorId, int type, MultipartFile file) throws IOException;

    /**
     * 专家列表
     *
     * @param pageParamsVO
     * @param doctorVO
     *
     * @return
     */
    PageVO<DoctorPageVO> findExpertPage(PageParamsVO pageParamsVO, DoctorPageVO doctorVO);

    /**
     * <pre>
     *     导入专家名医：
     *     1. 根据医生姓名和电话与已注册医生进行匹配
     *     2. 每条数据生成导入结果：
     *          a. 成功
     *          b. 重复导入（已经是名医）
     *          c. 信息不匹配（手机号与姓名信息不一致）
     *          d. 手机号未注册
     *          e. 导入失败，联系管理员
     * </pre>
     *
     * @param file
     *
     * @return 返回导入结果文件下载地址
     *
     * @throws BusinessException
     */
    String importExpert(MultipartFile file) throws BusinessException;

    /**
     * 移除专家名医
     *
     * @param doctorId
     *
     * @throws BusinessException
     */
    void removeExpert(Long doctorId);

    /**
     * 专家名医模板地址
     *
     * @return
     */
    String modelExpert();

    /**
     * 医生评价记录
     * @param doctorId
     * @return
     */
    PageVO<ConsultCommentVO> findCommentByDoctor(Long doctorId, PageParamsVO pageParamsVO) throws BusinessException;

    /**
     * 投诉记录
     * @param doctorId
     * @return
     */
    PageVO<ConsultComplaintVO> findComplaintByDoctor(Long doctorId, PageParamsVO pageParamsVO) throws BusinessException;

    /**
     * APP登录登出日志
     * @param loginLogParam
     * @param pageParamsVO
     * @return
     */
    PageVO<LoginLogVO> appLoginLog(LoginLogVO loginLogParam, PageParamsVO pageParamsVO);

    /**
     * 更新某个城市的医院信息
     * @param cityId
     */
    void removeHospitalCacheByCityId(Integer cityId);
	
	   /**
     * ocr识别
     * @param ocrParamVO 参数
     * @return 识别结果
     * @throws BusinessException
     */
    String ocrDistinguish(OcrParamVO ocrParamVO) throws BusinessException;

    /**
     * 导入医生信息
     * 
     * @param file
     * @return
     * @throws BusinessException
     */
    String importExpertDoctor(MultipartFile file) throws BusinessException;

}

